package com.ibeetl.admin.console.web.query.business;

import com.ibeetl.admin.core.annotation.Query;
import com.ibeetl.admin.core.util.Tool;
import com.ibeetl.admin.core.util.enums.CoreDictType;
import com.ibeetl.admin.core.web.query.PageParam;
import org.apache.commons.lang3.StringUtils;

import java.util.Date;

public class CoinGetQuery extends PageParam {

	@Query(name="用户Id",display=true)
	private String openid;
	
	@Query(name="微信昵称",display=true,fuzzy=true)
	private String nickname;
	//云币类型：A:直荐 ，B:转荐
	@Query(name="类型",display=true,type=Query.TYPE_DICT,dict= CoreDictType.COIN_TYPE)
	private String type;

	@Query(name="订单号",display=true,fuzzy=true)
	private String orderNo;
	@Query(name="充值人昵称",display=true,fuzzy=true)
	private String chargeNickname;
	//记录时间
	@Query(name="记录时间",display=true,type=Query.TYPE_DATE_BETWEEN)
	private String createTimeRange;
	private Date createTimeMin;
	private Date createTimeMax;

	public String getOpenid() {
		return openid;
	}

	public void setOpenid(String openid) {
		this.openid = openid;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getCreateTimeRange() {
		return createTimeRange;
	}

	public void setCreateTimeRange(String createTimeRange) {

		this.createTimeRange = createTimeRange;
		if(StringUtils.isEmpty(createTimeRange)) {
			return ;
		}
		Date[] ds = Tool.parseDataRange(createTimeRange);
		this.createTimeMin=ds[0];
		this.createTimeMax =ds[1];
	}

	public Date getCreateTimeMin() {
		return createTimeMin;
	}

	public void setCreateTimeMin(Date createTimeMin) {
		this.createTimeMin = createTimeMin;
	}

	public Date getCreateTimeMax() {
		return createTimeMax;
	}

	public void setCreateTimeMax(Date createTimeMax) {
		this.createTimeMax = createTimeMax;
	}

	public String getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(String orderNo) {
		this.orderNo = orderNo;
	}

	public String getChargeNickname() {
		return chargeNickname;
	}

	public void setChargeNickname(String chargeNickname) {
		this.chargeNickname = chargeNickname;
	}
}
